/* styles.css - 语雀转Markdown插件样式 */

/* 插件浮动工具栏 */
.yuque-markdown-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.yuque-markdown-toolbar.show {
    opacity: 1;
    transform: translateY(0);
}

.yuque-markdown-toolbar .toolbar-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin: 0 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.yuque-markdown-toolbar .toolbar-btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.yuque-markdown-toolbar .toolbar-btn:active {
    transform: translateY(0);
}

/* 转换进度指示器 */
.yuque-markdown-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 10001;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.yuque-markdown-progress.active {
    animation: progressBar 2s ease-in-out;
}

@keyframes progressBar {
    0% { transform: scaleX(0); }
    50% { transform: scaleX(0.8); }
    100% { transform: scaleX(1); }
}

/* 通知消息样式 */
.yuque-markdown-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 300px;
    word-wrap: break-word;
    animation: slideInRight 0.3s ease-out;
}

.yuque-markdown-notification.success {
    background: #10b981;
}

.yuque-markdown-notification.error {
    background: #ef4444;
}

.yuque-markdown-notification.warning {
    background: #f59e0b;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 语雀文档内容高亮 */
.yuque-markdown-highlight {
    outline: 2px solid #667eea !important;
    outline-offset: 2px;
    border-radius: 4px;
    position: relative;
}

.yuque-markdown-highlight::before {
    content: "📝 可转换区域";
    position: absolute;
    top: -25px;
    left: 0;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
}

/* 快捷键提示 */
.yuque-markdown-shortcut-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.yuque-markdown-shortcut-hint.show {
    opacity: 1;
    transform: translateY(0);
}

.yuque-markdown-shortcut-hint .shortcut-key {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    margin: 0 2px;
    font-weight: 500;
}

/* 语雀页面特定样式优化 */
.ne-viewer-body {
    transition: all 0.3s ease;
}

.ne-viewer-body.markdown-mode {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* 加载动画 */
.yuque-markdown-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    backdrop-filter: blur(10px);
}

.yuque-markdown-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.yuque-markdown-loading .loading-text {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .yuque-markdown-toolbar {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        left: 20px;
        width: auto;
        padding: 15px;
    }
    
    .yuque-markdown-notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .yuque-markdown-shortcut-hint {
        bottom: 80px;
        right: 20px;
        left: 20px;
        text-align: center;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .yuque-markdown-toolbar {
        background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .yuque-markdown-toolbar .toolbar-btn {
        background: rgba(255, 255, 255, 0.1);
        color: #f9fafb;
    }
    
    .yuque-markdown-toolbar .toolbar-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .yuque-markdown-loading {
        background: rgba(31, 41, 55, 0.95);
    }
    
    .yuque-markdown-loading .loading-text {
        color: #f9fafb;
    }
}

/* 无障碍访问 */
.yuque-markdown-toolbar:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.yuque-markdown-toolbar .toolbar-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .yuque-markdown-toolbar,
    .yuque-markdown-notification,
    .yuque-markdown-shortcut-hint,
    .yuque-markdown-loading {
        display: none !important;
    }
} 